package net.wanho.zx.zx_cms.controller;

import net.wanho.zx.pojo.cms.CmsConfig;
import net.wanho.zx.zx_cms.service.CmsConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import sun.security.krb5.Config;

import java.util.List;

/**
 * @author： Depeng.Xu
 * @date： 2020/10/27 18:09
 * @description： TODO
 * @version: 1.0
 */

@RestController
public class CmsConfigController {

    @Autowired
    private CmsConfigService cmsConfigService;


    @GetMapping("/cms/page/dataUrl")
    public List<CmsConfig> queryDataUrlList(){
        return cmsConfigService.queryDataUrlList();
    }

    @GetMapping("/cms/page/config/{dataurl}")
    public CmsConfig queryConfigByDataurl(@PathVariable("dataurl") String dataurl){
        return cmsConfigService.getConfigById(dataurl);
    }
}
